package edu.ccut.saturn.studio.naviagtor.actions;

import org.eclipse.jface.wizard.WizardDialog;
import org.eclipse.ui.IWorkbenchWindow;
import org.eclipse.ui.PlatformUI;

import edu.ccut.saturn.studio.Activator;
import edu.ccut.saturn.studio.Images;
import edu.ccut.saturn.studio.core.util.action.SaturnAction;
import edu.ccut.saturn.studio.core.util.eclipse.Messages;
import edu.ccut.saturn.studio.naviagtor.wizard.project.SaturnProjectNewWizard;

public class NewSaturnProjectAction extends SaturnAction {

	public NewSaturnProjectAction() {
		this(PlatformUI.getWorkbench().getActiveWorkbenchWindow());
	}

	public NewSaturnProjectAction(IWorkbenchWindow window) {
		setText(Messages.getString("NewSaturnProjectAction.createSaturnproject")); //$NON-NLS-1$

		// setImageDescriptor(Activator
		// .getImageDescriptor("icons/persistence_small.GIF"));
		setImageDescriptor(Activator
				.getImageDescriptor(Images.NEWSATURN_PROJECT_ACTION));
	}

	public void run() {
		SaturnProjectNewWizard wizard = new SaturnProjectNewWizard();
		wizard.init(PlatformUI.getWorkbench(), super.getStructuredSelection());
		WizardDialog wizarddialog = new WizardDialog(PlatformUI.getWorkbench()
				.getActiveWorkbenchWindow().getShell(), wizard);
		wizarddialog.open();
	}
}
